<template>
  <div>
    <h2>编译</h2>
    <pre class="code">{{pyCode}}</pre>
  </div>
</template>

<script type="text/javascript">
import code from '@/code/program';
import Walker from '@/walker';
import PyWalker from '@/walker/py';

const acorn = require('acorn');

export default {
  data() {
    const tree = acorn.parse(code);
    const pyCode = new Walker(PyWalker, {}).walk(tree);

    return {
      pyCode,
    };
  },
};
</script>

<style type="text/css">
</style>
